package com.ctgu.chatapp.model.Database

import android.content.Context
import androidx.room.Room

class DataBaseManager {
    companion object {
        @Volatile
        private var INSTANCE: IMSDataBase? = null
        fun getInstance(context: Context): IMSDataBase {
            synchronized(this) {
                var instance = INSTANCE
                if (instance == null) {
                    instance =
                        Room.databaseBuilder(
                            context.applicationContext,
                            IMSDataBase::class.java,
                            "user_table"
                        ).build()
                    INSTANCE = instance
                }
                return instance
            }
        }
    }
}